import {Route, Routes, Navigate } from 'react-router-dom'
import Home from "./pages/Home";
import InulaPage from "./pages/inula";
import InulaComponentPage from "./pages/inulaComponent";

export default function Routers(props) {
  return <Routes>
      <Route exact path='/home' element={<Home changeActive={props.active}/>} />

      <Route exact path="/inula" element={<InulaPage />} />
      <Route exact path="/inula-sub/:path" element={<InulaPage />} />
      <Route exact path="/inulaComponent" element={<InulaComponentPage />} />
      <Route exact path="/inulaComponent-sub/:path" element={<InulaComponentPage />} />
      {/* 重定向到首页 */}
      <Route path="*" element={<Navigate to="/home" replace />} />

    </Routes>
}